const baseUrl = 'https://tea.qingnian8.com/api/bizhi/'
const timeout = 1000 * 100

const request = (params) => {
	return new Promise((resolve, reject) => {
		uni.request({
			url: baseUrl + params.url,
			method: params.method || 'GET',
			data: params.data || {},
			timeout,
			header: {
				"access-key": "self0829"
			},
		}).then(response => {
			const result = response.data
			resolve(response.data)
		}).catch(error => {
			reject(error)
		})
	})
}

export default request